﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="IpBlockItem.aspx.cs" Inherits="Manage_System_IpBlockItem" %>

<html>
<head>
    <!--#include file="../js/html_head.inc"-->
    <link rel="stylesheet" type="text/css" href="../Themes/<%=ManageHelper.GetTheme()%>/style.css" />

    <script type="text/javascript">
    function Check(obj)
    {
        var err="";
        $.ajax({
            type:"POST",
            async:false,
            url:"?",
            data:"act=check&ID=<%=ID%>&BlockModule=<%=BlockModule%>&BlockType=<%=BlockType%>&IpName="+document.getElementById("IpName").value,
            success:function(msg){
                if(msg=='-1')
                    err= "*IP访问规则格式错误";
                else if(msg=='-2')
                    err= "*该IP访问规则已经存在";
                else if(msg!='1')
                    err="*请输入IP访问规则";
            }
        });
        return err;
    }
    </script>

</head>
<body>
    <div class="mycolumn" style="border: 0px">
        <form id="myForm" name="myForm" method="post" action="?" onsubmit="return validator(this)">
            <input type="hidden" name="ID" value="<%=ID%>" />
            <input type="hidden" name="BlockModule" value="<%=BlockModule%>" />
            <input type="hidden" name="BlockType" value="<%=BlockType%>" />
            <input type="hidden" name="act" value="<%=ID>0?"save":"add" %>" />
            <table cellpadding="2" width="98%" align="center">
                <tr>
                    <td colspan="2">
                        <div class="tips">
                            提示：<br>
                            xxx.xxx.xxx.xxx = 精确匹配<br>
                            xxx.xxx.xxx.xxx-xxx.xxx.xxx.xxx = 范围<br>
                            xxx.xxx.xxx.* = 任何匹配</div>
                    </td>
                </tr>
                <tr>
                    <td align="left" width="100">
                        <img src="../pic/icons/help.gif" alt="IP访问规则" onclick="helpInf(this)" />
                        IP访问规则：</td>
                    <td align="left">
                        <input id="IpName" name="IpName" type="text" value="<%=IpName %>" valid="required|ajax"  errmsg="*请输入IP访问规则。|Check()"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center" class="tdbutton">
                        <input type="submit" value="确 定" />&nbsp;&nbsp;
                        <input type="button" value="取 消" onclick="window.parent.ymPrompt.doHandler('close');"
                            />
                    </td>
                </tr>
            </table>
        </form>
    </div>
</body>
</html>
